// ignore_for_file: dangling_library_doc_comments, slash_for_doc_comments
import 'package:flutter/material.dart';
import 'package:wan_android_flutter/module_code/short_video/api/short_video_api.dart';

import '../models/short_video_list_model.dart';
import '../widgets/short_video_page_cell.dart';

/*** 
 * @Author: Zhong
 * @Date: 2025-07-15 15:05:48
 * @LastEditors: Zhong zhongxiaodong@eenet.com
 * @LastEditTime: 2025-08-26 11:34:43
 * @FilePath: /wan_android_flutter/lib/module_code/short_video/pages/short_video_page.dart
 * @Description: 
 */

class ShortVideoPage extends StatefulWidget {
  const ShortVideoPage({super.key});

  @override
  State<ShortVideoPage> createState() => _ShortVideoPageState();
}

class _ShortVideoPageState extends State<ShortVideoPage> {

  List<ShortVideoListItemModel>? videoList;
  @override
  void initState() {
    super.initState();

    // 获取视频列表接口
    ShortVideoApi.getVideoListData().then((result) {
      setState(() {
        videoList = result;
      });
    });
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("短视频")),
      body: ListView.builder(
        itemBuilder: (context, index) {
          return ShortVideoPageCell(item: videoList![index],);
        },
        itemCount: videoList?.length ?? 0,
      ),
    );
  }
}
